<?php
namespace  Admin\Model;
use  Think\Model;
class SendModel extends Model {
 
	protected  $autoCheckFields=false;
	//==============================用户操作
	public function listPorders($firstRow = 0, $listRows = 10) {
		$list = $this->order("`id` DESC")->limit("$firstRow , $listRows")->select();
		return $list;
	}
   
	/**
	 +----------------------------------------------------------
	 * 添加发货
	 +----------------------------------------------------------
	 */
	public function addAdmin($data) {
		if (empty($data['city'])) {
			$this->error="城市不能为空";
			return false;
		}
		if (empty($data['name'])) {
			$this->error="姓名不能为空";
			return false;
		}
		if (empty($data['phone'])) {
			$this->error="电话不能为空";
			return false;
		}
		if ($this->add($datas)) {
			return true;
		} else {
			$this->error="添加失败";
			return false;
	
		}
	}
	
	/**
	 +----------------------------------------------------------
	 *修改发货
	 +----------------------------------------------------------
	 */
	public function editAdmin($data) {
		if (empty($data['id'])) {
			$this->error="ID不存在，不允许修改";
			return false;
		}
		
		if ($this->save($datas)) {
			return true;
		} else {
			$this->error="修改失败";
			return false;
	
		}
	}
	
}

?>
